package code._10string._04sort.demo2;

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
        Student s1 = new Student("zs", 22, 88);
        Student s2 = new Student("ls", 21, 59);
        Student s3 = new Student("ww", 20, 77);
        Student s4 = new Student("zl", 25, 66);
        Student s5 = new Student("sq", 21, 99);
        // 放入数组中
        Student[] students = {s1, s2, s3, s4, s5};

        //studens中已经确定好规则Comparable、故直接调用Arrys.sort()即可
        Arrays.sort(students);
        System.out.println(Arrays.toString(students));
    }
}
